package com.caigou.modules.channel.adapter

import com.caigou.comm.base.utils.ImageLoader
import com.caigou.modules.channel.R
import com.caigou.modules.channel.bean.MedalItemBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author #Suyghur.
 * Created on 2021/10/13
 */
class MedalItemAdapter(dataset: MutableList<MedalItemBean>) :
    BaseQuickAdapter<MedalItemBean, BaseViewHolder>(R.layout.item_medal_list, dataset) {


    override fun convert(holder: BaseViewHolder, item: MedalItemBean) {
        holder.setText(R.id.medal_item_tv_display, item.medalName)
        ImageLoader.loadCircle(context, item.medalIcon, holder.getView(R.id.medal_item_iv_display))
    }

//    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
//        val binding = if (convertView == null) {
//            ItemMedalListBinding.inflate(LayoutInflater.from(context))
//        } else {
//            convertView.tag as ItemMedalListBinding
//        }
//
//        val view = convertView ?: binding.root
//        view.tag = binding
//
//        val item = items[position]
//        binding.medalItemTvDisplay.text = item.medalName
//        ImageLoader.load(context, item.medalIcon, binding.medalItemIvDisplay)
//        return view
//    }
}